package com.tmxk.api.day05.gull.io;

import java.io.Serializable;

public class Person  implements Serializable{
    // 序列化ID
    private static final long serialVersionUID = 1L;

    private int pid;
    private String name;
    // transient : 隐藏序列化的指定属性,确保程序安全
    transient String pwd;
    private double height;
    // static修饰的成员不能被序列化
    static String sex;

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public static String getSex() {
        return sex;
    }

    public static void setSex(String sex) {
        Person.sex = sex;
    }

    public Person() {
    }

    public Person(int pid, String name, String pwd, double height) {
        this.pid = pid;
        this.name = name;
        this.pwd = pwd;
        this.height = height;
    }

    @Override
    public String toString() {
        return "Person{" +
                "pid=" + pid +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", height=" + height +
                '}';
    }
}
